const oli=document.getElementById("shangdian");
const oul=document.querySelector(".gouwudai-xiala"); 
var i=0;
oli.onclick=function(eve){
    let e=eve||window.event;
    stopBubble(e);
   
    if(i==0){
        oul.style.display="block";
        
        i=1;
    }else{
        oul.style.display="none";
        i=0;
    }
    document.onclick=function(){
    oul.style.display="none";
    i=0;
    console.log(1)
    }
   
    
    

}
// 阻止事件冒泡，兼容封装
function stopBubble(e){
    if(e.stopPropagation){
        e.stopPropagation();
    }else{
        e.cancelBubble=true;
    }
}